package IO流;

import java.io.*;

public class IO流_8_缓冲字符流_输出 {
    public static void main(String[] args) throws Exception {
        IO流_8_缓冲字符流_输出 dx = new IO流_8_缓冲字符流_输出();
//        dx.test();
//        dx.test1();
        dx.test2();
    }

    public void test() throws Exception {// 字节输入流
        FileReader red =  new FileReader("F:\\java_IO\\a\\io3.txt");


        BufferedReader br = new BufferedReader(red);

        char[]  c  = new  char[100];

        br.read(c);
        System.out.println(new String(c));

        br.close();
    }
    public void test1() throws Exception {//  字节输出流
        FileWriter fw = new FileWriter("F:\\java_IO\\a\\io4.txt");

        BufferedWriter bw = new BufferedWriter(fw);

        String x = "WDWDwdwdd";
        bw.write(x);
        bw.flush();

        bw.close();
        fw.close();


    }
    public void  test2() throws Exception {
        BufferedReader br = new BufferedReader(new FileReader("F:\\java_IO\\a\\io4.txt"));

        BufferedWriter bw = new BufferedWriter(new FileWriter("F:\\java_IO\\a\\io5.txt"));

        char[] c = new  char[100];
        br.read(c);
        System.out.println(new String(c));

        bw.write(c);

        bw.close();
        br.close();
    }

}
